function AWZnew()
    
    t={}
    t["awz一键新机"]={{{115,618,0x7c7e85},{120,620,0xffffff},{271,603,0x6f7179},{693,610,0x6f7179},{701,818,0x6f7179},{286,616,0x6f7179},{337,86,0x000000},{50,818,0x6f7179}},90,0,0,0,0}
    t["awz正在新机"]={{{156,577,0xd2d3d5},{143,577,0xffffff},{595,578,0xd2d2d5},{609,582,0xffffff},{593,759,0xd2d3d4},{612,758,0xffffff}},90,131,552,622,784}
    t["awz返回"]={{{61,82,0x007aff},{34,95,0x007aff},{487,1291,0xff0080},{689,1284,0x0f80fe}},90,15,58,730,1313}
	
    active("AWZ", 3)

    get('http://127.0.0.1:1688/cmd?fun=deleteallrecords')
    delay(3)
    d(t["awz返回"], "awz返回", true, 1)
    
    timeLine = os.time()
    local click = true

    -- deviceInfo = AWZread()
    -- idfa = deviceInfo.IDFA

    while os.time()-timeLine < 90 do
        if click and d(t["awz一键新机"], 'awz一键新机', true, 5) then
            click = false
        elseif d(t["awz正在新机"], "awz正在新机") then
        elseif d(t["awz返回"], "awz返回", true, 1) then
        elseif click ~= true then
            deviceInfo = AWZread()
            if deviceInfo then
                if deviceInfo.IDFA then
                    return true
                end
            end
        end
        delay(1)
    end

end


function AWZread()

    active("AWZ", 3)
    url = "http://127.0.0.1:1688/cmd?fun=getcurrentrecordparam"
    ret = get(url)
    
    if ret then
        log(ret)
        ret = json.decode(ret)
        if ret['result'] == 1 then
            data = file.get_lines("/var/mobile/iggparams.txt");
            -- sys.log(data)
            deviceInfo = {}
            for key, value in pairs(data) do
                row = string.split(value, ":")
                -- deviceInfo[row[1]] = row[2]
                if row[1] then
                    deviceInfo[row[1]] = row[2]
                end
                -- log(row)
            end
            log(deviceInfo)
            return deviceInfo
        end
    end
end